<template>
	<a-card style="margin: -15px">
		<a-row style="margin-bottom: 1rem">
			<a-col :span="6">
				<a-input-search
					v-model:value=this.page.keyword
					placeholder="请填写任务名称/优先购藏品名称"
					enter-button="搜索"
					size="large"
					@search="onSearch"
				/>
			</a-col>
			<a-col :push=this.num :span="3">
				<a-button type="primary" style="width: 150px;height: 40px" @click="showDrawer">
					<PlusOutlined/>
					优先购快照任务
				</a-button>
			</a-col>
		</a-row>
		<a-row style="margin-bottom: 1rem">
			<a-col :span="24">
				<a-table :columns="columns" :data-source="data" :pagination="false" @change="onChange">
					<template #bodyCell="{ column, record }">

						<!--藏品-->
						<template v-if="column.key === 'rofoName'">
							<a-row style="margin-top: 0.5rem">
								<a-col>
									<img :src="record.cover" width="50" height="50">
								</a-col>
								<a-col style="margin: auto">
									<a @click="getNft(record.nftId)">{{ record.name }}</a>
									<br/>
									X1
								</a-col>
							</a-row>
						</template>
						<!--条件项-->
						<template v-if="column.key === 'condition'">
							<a-row style="margin-top: 0.5rem" v-for="rofoHold in record.opRofoHoldLimtVos">
								<a-col>
									<img :src="rofoHold.cover" width="50" height="50">
								</a-col>
								<a-col style="margin: auto">
									<a @click="getNft(rofoHold.nftId)">{{ rofoHold.name }}</a>
									<br/>
									X{{ rofoHold.number }}
								</a-col>
							</a-row>


						</template>
						<!--操作-->
						<template v-if="column.key === 'action'">
							<a-dropdown>
								<template #overlay>
									<a-menu>
										<a-menu-item key="1" v-if="record.status==0" @click="enableRofo(record.id)">启用
										</a-menu-item>
										<a-menu-item key="2" v-if="record.status==1" @click="disRofo(record.id)">禁用
										</a-menu-item>
										<a-menu-item key="3" v-if="record.status==0" @click="editRofo(record.id)">编辑
										</a-menu-item>
										<a-menu-item key="4" @click="getRofo(record.id)">查看</a-menu-item>
										<a-menu-item key="5" v-if="record.status==0" @click="delrofoInfo(record.id)">删除
										</a-menu-item>
										<a-menu-item key="6" v-if="record.status==1" @click="execute(record.id)">快照
										</a-menu-item>
										<a-menu-item key="7" v-if="record.status==2" @click="exelog(record.id)">执行日志
										</a-menu-item>
									</a-menu>
								</template>
								<a-button>
									操作
									<DownOutlined/>
								</a-button>
							</a-dropdown>
						</template>
						<!--状态-->
						<template v-if="column.key === 'status'">
							<a-tag v-if="record.status==0" :bordered="false" color="default">未启用</a-tag>
							<a-tag v-if="record.status==1" :bordered="false" color="orange">待快照</a-tag>
							<a-tag v-if="record.status==2" :bordered="false" color="success">已快照</a-tag>
							<a-tag v-if="record.status==3" :bordered="false" color="error">已完成</a-tag>
						</template>
						<!--资格名单-->
						<template v-if="column.key === 'qualifica'">
							<a-tag :bordered="false" color="success" @click="qualification(record.id)">查看名单</a-tag>
						</template>

					</template>
				</a-table>
			</a-col>
		</a-row>

		<a-flex justify="flex-end">
			<a-pagination
				size="small"
				@change="onChange"
				show-size-changer
				:pageSizeOptions="['5','10','20','50','100']"
				v-model:current="this.page.pageNo"
				v-model:page-size="this.page.pageSize"
				:total="this.page.total"
				:show-total="(total, range) => `${range[0]}-${range[1]} 共 ${total} 条`"/>
		</a-flex>


<!--		<a-row style="margin-bottom: 1rem">-->
<!--			<a-col :push=this.pagination :span="13">-->
<!--				<a-pagination v-model:current=this.page.pageNo v-model:page-size=this.page.pageSize show-quick-jumper-->
<!--							  :pageSizeOptions="['10','20','40']" :total=this.page.total @change="onChange"/>-->
<!--			</a-col>-->
<!--		</a-row>-->

		<!--添加抽屉-->
		<a-drawer
			title="新增（优先购快照）任务"
			:width="750"
			v-model:open="this.open"
			:body-style="{ paddingBottom: '80px' }"
			:footer-style="{ textAlign: 'right' }">

			<template #extra>
				<a-space>
					<a-button @click="onClose">重置</a-button>
					<a-button type="primary" @click="onSubmit()">保存</a-button>
				</a-space>
			</template>

			<a-form :model="rofoInfo" layout="vertical" ref="formRef">
				<a-card title="基本信息">

					<a-row :gutter="16">
						<!--任务名称-->
						<a-col :span="12">
							<a-form-item label="任务名称 : " name="taskName"
										 :rules="[{required:true,message:'请填写活动名称',trigger:'blur'}]">
								<a-input v-model:value="rofoInfo.taskName" placeholder="任务名称" style="width: 100%"/>
							</a-form-item>
						</a-col>
						<!--快照时间-->
						<a-col :span="12">
							<a-form-item label="快照时间 :" name="snapshotTime"
										 :rules="[{required:true,message:'请选择快照时间',trigger:'blur'}]">
								<a-date-picker show-time placeholder="请选择快照时间"
											   v-model:value="rofoInfo.snapshotTime" value-format="YYYY-MM-DD HH:mm:ss"
											   style="width: 100%"/>
							</a-form-item>
						</a-col>
					</a-row>

					<a-row :gutter="16">
						<!--优先购藏品-->
						<a-col :span="12">
							<a-form-item label="优先购藏品 : " name="nftId"
										 :rules="[{required:true,message:'请选择活动藏品',trigger:'blur'}]">
								<a-select
									v-model:value="rofoInfo.nftId" show-search :options="filterInfo.options"
									:field-names="filterInfo.fieldNames"
									option-filter-prop="name" placeholder="请选择优先购藏品" style="width: 100%">
								</a-select>

							</a-form-item>
						</a-col>
						<!--优先购藏品数量-->
						<a-col :span="12">
							<a-form-item label="优先购藏品数量 : ">
								<a-input placeholder="默认数量 : 1" style="width: 100%" disabled="true"/>
							</a-form-item>
						</a-col>
					</a-row>
				</a-card>

				<a-card title="条件选择" style="margin-top: 1rem">
					<a-row :gutter="16" v-for="(rofoHold, index) in rofoInfo.opRofoHoldLimtBos">

						<a-col :span="12">
							<a-form-item :name="['opRofoHoldLimtBos', index, 'nftId']"
										 :rules="[{required:true,message:'请选择活动藏品',trigger:'blur'}]"
										 style="width: 100%">
								<a-select
									v-model:value="rofoHold.nftId" show-search :options="condFilterInfo.options"
									:field-names="condFilterInfo.fieldNames"
									option-filter-prop="name" placeholder="请选择活动藏品" style="width:100%">
								</a-select>
							</a-form-item>
						</a-col>

						<a-col :span="11">
							<a-form-item
								:name="['opRofoHoldLimtBos', index, 'number']"
								:rules="[{required:true,message:'请填写条件藏品数量',trigger:'blur'}]"
								style="width:100%">
								<!--              <a-input v-model:value="rofoHold.number" placeholder="藏品数量"/>-->
								<a-input-number v-model:value="rofoHold.number" style="width:100%" :min="1"
												:max="100000"
												placeholder="藏品数量"/>
							</a-form-item>
						</a-col>
						<a-col :span="1">
							<MinusCircleOutlined @click="removeUser(rofoHold)" style="width: 50px;height: 30px"/>
						</a-col>
					</a-row>

					<a-form-item>
						<a-button type="dashed" block @click="addRofo()" style="width: 100%">
							<PlusOutlined/>
							持有条件
						</a-button>
					</a-form-item>
				</a-card>
			</a-form>


		</a-drawer>

		<!--修改抽屉-->
		<a-drawer
			title="编辑（优先购快照）任务"
			:width="750"
			v-model:open="this.dictopen"
			:body-style="{ paddingBottom: '80px' }"
			:footer-style="{ textAlign: 'right' }"
		>

			<template #extra>
				<a-space>`
					<a-button @click="dictonClose()">重置</a-button>
					<a-button type="primary" html-type="submit" @click="edit()">保存</a-button>
				</a-space>
			</template>
			<a-form :model="getrofo" layout="vertical" ref="dictFormRef">
				<a-card title="基本信息">
					<a-row :gutter="16">
						<!--任务名称-->
						<a-col :span="12">
							<a-form-item label="任务名称 : " name="taskName"
										 :rules="[{required:true,message:'请填写活动名称',trigger:'blur'}]">
								<a-input v-model:value="getrofo.taskName" placeholder="任务名称" style="width: 100%"/>
							</a-form-item>
						</a-col>
						<!--快照时间-->
						<a-col :span="12">
							<a-form-item label="快照时间 :" name="snapshotTime"
										 :rules="[{required:true,message:'请选择快照时间',trigger:'change'}]">
								<a-date-picker show-time placeholder="请选择快照时间" value-format="YYYY-MM-DD HH:mm:ss"
											   v-model:value="getrofo.snapshotTime"
											   style="width: 100%"/>
							</a-form-item>
						</a-col>
					</a-row>
					<a-row :gutter="16">
						<!--优先购藏品-->
						<a-col :span="12">
							<a-form-item label="优先购藏品 : " name="nftId"
										 :rules="[{required:true,message:'请选择活动藏品',trigger:'blur'}]">
								<a-select
									v-model:value="getrofo.nftId" show-search :options="filterInfo.options"
									:field-names="filterInfo.fieldNames"
									option-filter-prop="name" placeholder="请选择优先购藏品" style="width:100%">
								</a-select>

							</a-form-item>
						</a-col>
						<!--优先购藏品数量-->
						<a-col :span="12">
							<a-form-item label="优先购藏品数量 : ">
								<a-input placeholder="默认数量 : 1" style="width:100%" disabled="true"/>

							</a-form-item>
						</a-col>
					</a-row>
				</a-card>

				<a-card title="条件选择" style="margin-top: 1rem">
					<a-row :gutter="16" v-for="(rofoHold, index) in getrofo.rofoHoldLimtVos">

						<a-col :span="12">
							<a-form-item :name="['rofoHoldLimtVos', index, 'nftId']"
										 :rules="[{required:true,message:'请选择活动藏品',trigger:'blur'}]"
										 style="width: 100%">
								<a-select
									v-model:value="rofoHold.nftId" show-search :options="condFilterInfo.options"
									:field-names="condFilterInfo.fieldNames"
									option-filter-prop="name" placeholder="请选择活动藏品" style="width:100%">
								</a-select>
							</a-form-item>
						</a-col>

						<a-col :span="11">
							<a-form-item
								:name="['rofoHoldLimtVos', index, 'number']"
								:rules="[{required:true,message:'请填写条件藏品数量',trigger:'blur'}]"
								style="width:100%">
								<!--              <a-input v-model:value="rofoHold.number" placeholder="藏品数量"/>-->
								<a-input-number v-model:value="rofoHold.number" style="width:100%" :min="1"
												:max="100000"
												placeholder="藏品数量"/>
							</a-form-item>
						</a-col>

						<a-col :span="1">
							<MinusCircleOutlined @click="dictremoveUser(rofoHold)" style="width: 50px;height: 30px"/>
						</a-col>

					</a-row>


					<a-form-item>
						<a-button type="dashed" block @click="dictaddRofo()" style="width: 100%">
							<PlusOutlined/>
							持有条件
						</a-button>
					</a-form-item>
				</a-card>
			</a-form>
		</a-drawer>

		<!--查看详情-->
		<template>
			<div>
				<a-modal v-model:open="this.viewopen" width="800px" title="查看优先购活动" :footer="null">
					<a-card title="基本信息">
						<a-descriptions title="" :column="1">
							<a-descriptions-item label="任务名称">{{ getData.taskName }}</a-descriptions-item>
							<a-descriptions-item label="状态">
								{{ getData.status == 0 ? '未启用' : getData.status == 1 ? '待快照' : '已完成' }}
							</a-descriptions-item>
							<a-descriptions-item label="快照时间">{{ getData.snapshotTime }}</a-descriptions-item>
							<a-descriptions-item label="创建人">{{ getData.createUser }}</a-descriptions-item>
							<a-descriptions-item label="创建时间">{{ getData.createTime }}</a-descriptions-item>
							<a-descriptions-item label="更新人">{{ getData.updateUser }}</a-descriptions-item>
							<a-descriptions-item label="更新时间">{{ getData.updateTime }}</a-descriptions-item>
						</a-descriptions>
					</a-card>

					<a-card title="优先购活动藏品信息">
						<a-table :columns="getcolumns" :data-source="nftData" :pagination="false">

							<template #bodyCell="{ column, record }">
								<template v-if="column.key === 'cover'">
									<img :src="record.cover" width="50" height="50">
								</template>
								<template v-if="column.key === 'name'">
									<p>{{ record.name }}</p>
								</template>
								<template v-if="column.key === 'number'">
									<p>1</p>
								</template>
							</template>
						</a-table>
					</a-card>

					<a-card title="活动条件藏品信息">
						<a-table :columns="getcolumns" :data-source="condition" :pagination="false">
							<template #bodyCell="{ column, record }">
								<template v-if="column.key === 'cover'">
									<img :src="record.cover" width="50" height="50">
								</template>
								<template v-if="column.key === 'name'">
									<p>{{ record.name }}</p>
								</template>
								<template v-if="column.key === 'number'">
									<p>{{ record.number }}</p>
								</template>
							</template>
						</a-table>
					</a-card>
				</a-modal>
			</div>
		</template>

		<!--名单列表-->
		<template>
			<div>
				<a-modal v-model:open="this.listopen" width="1000px" title="资格名单" :footer="null">
					<a-card>
						<a-row style="margin-bottom: 1rem">
							<a-col :span="6">
								<a-input-search
									v-model:value=this.qualilist.name
									placeholder="搜索会员"
									enter-button="搜索"
									size="large"
									@search="onSearchList"
								/>
							</a-col>
						</a-row>
						<a-table :columns="listcolumns" :data-source="rendering" :pagination="false"
								 style="text-align: center">
							<template #bodyCell="{ column, record }">
								<template v-if="column.key === 'number'">
									<a-tag color="orange">
										{{ record.number }}
									</a-tag>
								</template>
								<template v-if="column.key === 'status'">
									<a-tag :bordered="false" :color="record.status==0 ? 'success': 'error' ">
										{{ record.status == 0 ? '正常' : '异常' }}
									</a-tag>
								</template>
							</template>
						</a-table>
<!--						<a-row style="margin-top: 2rem">-->
<!--							<a-col :push=this.quakipag :span="12">-->
<!--								<a-pagination v-model:current=this.pagelist.pageNo-->
<!--											  v-model:page-size=this.pagelist.pageSize-->
<!--											  show-quick-jumper-->
<!--											  :pageSizeOptions="['10','20','40']" :total=this.pagelist.total-->
<!--											  @change="onChangeList"/>-->
<!--							</a-col>-->
<!--						</a-row>-->

						<a-flex justify="flex-end">
							<a-pagination
								size="small"
								@change="onChangeList"
								show-size-changer
								:pageSizeOptions="['5','10','20','50','100']"
								v-model:current="this.pagelist.pageNo"
								v-model:page-size="this.pagelist.pageSize"
								:total="this.pagelist.total"
								:show-total="(total, range) => `${range[0]}-${range[1]} 共 ${total} 条`"/>
						</a-flex>
					</a-card>


				</a-modal>

			</div>

		</template>

		<!--执行日志列表-->
		<template>
			<div>
				<a-modal v-model:open="this.exeLog" width="800px" title="执行日志" :footer="null">
					<a-card>

						<a-table :columns="Logcolumns" :data-source="exeLogList" :pagination="false"
								 style="text-align: center">
							<template #bodyCell="{ column, record }">

								<template v-if="column.key === 'status'">
									<a-tag :bordered="false" :color="record.status==0 ? 'success': 'error' ">
										{{ record.status == 0 ? '执行成功' : '执行失败' }}
									</a-tag>
								</template>

								<template v-if="column.key === 'executeTime'">
									{{ record.executeTime }}
								</template>

							</template>
						</a-table>
					</a-card>


				</a-modal>

			</div>

		</template>
	</a-card>
</template>

<script>
import {message} from 'ant-design-vue';
import rofoApi from "@/api/nft/activity/rofoApi";
import dayjs from "dayjs";

import {
	PieChartOutlined,
	DesktopOutlined,
	UserOutlined,
	TeamOutlined,
	FileOutlined,
	PlusOutlined,
	DownOutlined,
	MinusOutlined,
	MinusCircleOutlined,
} from '@ant-design/icons-vue';
// import GatNftInfo from "../../components/GatNftInfo.vue";
const key = 'updatable';
export default {
	name: "Rofo",
	components: {
		PieChartOutlined,
		DesktopOutlined,
		UserOutlined,
		TeamOutlined,
		FileOutlined,
		PlusOutlined,
		DownOutlined,
		MinusOutlined,
		MinusCircleOutlined,
	},
	data() {
		return {
			rendering: [],
			qualilist: {
				id: null,
				name: null
			},
			pagelist: {
				pageNo: 1,
				pageSize: 5,
				total: 100,
			},
			filterInfo: {
				fieldNames: {label: 'name', value: 'id'},
				options: [],
			},
			condFilterInfo: {
				fieldNames: {label: 'name', value: 'id'},
				options: [],
			},

			nftData: [],
			getData: [],
			condition: [],
			data: [],
			viewopen: false,
			num: 15,
			quakipag: 10,
			pagination: 11,
			size: 20,
			open: false,
			dictopen: false,
			listopen: false,
			exeLog: false,
			page: {
				pageNo: 1,
				pageSize: 5,
				total: 100,
				keyword: ''
			},
			columns: [
				{
					title: '任务名称',
					dataIndex: 'taskName',
					key: 'taskName',
				},

				{
					title: '优先购藏品',
					dataIndex: 'rofoName',
					key: 'rofoName',
				},
				{
					title: '优先购条件',
					dataIndex: 'condition',
					key: 'condition',
				},
				{
					title: '状态',
					dataIndex: 'status',
					key: 'status',
				},
				{
					title: '快照时间',
					dataIndex: 'snapshotTime',
					key: 'snapshotTime',
				},
				{
					title: '资格名单',
					key: 'qualifica',
				},
				{
					title: '创建时间',
					dataIndex: 'createTime',
					key: 'createTime',
				},
				{
					title: '操作',
					key: 'action',
				},
			],
			getcolumns: [
				{
					title: '藏品',
					dataIndex: 'cover',
					key: 'cover',
				}, {
					title: '藏品名称',
					dataIndex: 'name',
					key: 'name',
				},
				{
					title: '数量',
					key: 'number',
				}
			],
			rofoInfo: {
				taskName: null,
				snapshotTime: null,
				nftId: null,
				opRofoHoldLimtBos: [
					{
						nftId: null,
						number: null,
					}
				]
			},
			getrofo: {
				id: null,
				name: null,
				cover: null,
				createTime: null,
				createUser: null,
				deleteFlag: null,
				taskName: null,
				snapshotTime: null,
				nftId: null,
				rofoHoldLimtVos: [
					{
						nftId: null,
						number: null,
					}
				],
			},
			dictRofo: {
				id: null,
				taskName: null,
				snapshotTime: null,
				nftId: null,
				opRofoHoldLimtBos: [{nftId: null, number: null}],
			},
			listcolumns: [
				{
					title: '任务名称',
					dataIndex: 'taskName',
					key: 'taskName',
				}, {
					title: '会员名称',
					dataIndex: 'mbName',
					key: 'mbName',
				}, {
					title: '购买次数',
					dataIndex: 'number',
					key: 'number',
				}, {
					title: '状态',
					dataIndex: 'status',
					key: 'status',
				}, {
					title: '创建时间',
					dataIndex: 'creationTime',
					key: 'creationTime',
				},
			],
			Logcolumns: [
				{
					title: '状态',
					dataIndex: 'status',
					key: 'status',
				}, {
					title: '执行时间',
					dataIndex: 'executeTime',
					key: 'executeTime',
				}, {
					title: '说明',
					dataIndex: 'remark',
					key: 'remark',
				}],
			qualiList: [],
			exeLogList: [],
		};
	},
	methods: {
		getMB(id) {
			this.$refs.getMb.showGetMb(id);
		},
		getNft(id) {
			this.$refs.getNft.getNft(id);
		},
		//名单列表
		qualification(id) {
			debugger
			this.qualilist.id = id;
			debugger
			this.listopen = true
			rofoApi.qualification(this.pagelist.pageNo, this.pagelist.pageSize, this.qualilist).then((resp) => {

				this.pagelist.pageSize = resp.size;
				this.pagelist.total = resp.total;
				this.rendering = resp.records;
			})
		},
		//查询列表
		query() {
			rofoApi.query(this.page.pageNo, this.page.pageSize, {rofoName: this.page.keyword}).then((resp) => {
				this.page.pageSize = resp.size;
				this.page.total = resp.total;
				this.data = resp.records;
			})
		},
		//搜索之前先把页码置为1[查询列表]
		onSearch() {
			this.page.pageNo = 1;
			this.query();
		},
		//搜索之前先把页码置为1[名单列表]
		onSearchList() {
			this.pagelist.pageNo = 1;
			this.qualification(this.qualilist.id)
		},
		//保存删减
		removeUser(rofoHold) {
			debugger
			const index = this.rofoInfo.opRofoHoldLimtBos.indexOf(rofoHold);
			if (index !== -1) {
				this.rofoInfo.opRofoHoldLimtBos.splice(index, 1);
			}
		},
		//编辑删减
		dictremoveUser(item) {
			debugger
			const index = this.getrofo.rofoHoldLimtVos.indexOf(item);
			if (index !== -1) {
				this.getrofo.rofoHoldLimtVos.splice(index, 1);
			}
		},
		onChange(pageNo) {
			debugger
			this.query();
			this.page.pageNo = pageNo;
		},
		onChangeList(pageNo) {
			debugger
			this.qualification(this.qualilist.id)
			this.pagelist.pageNo = pageNo;

		},
		showDrawer() {
			this.open = true;
			this.rofoInfo = {
				taskName: null,
				snapshotTime: null,
				nftId: null,
				opRofoHoldLimtBos: [
					{
						nftId: null,
						number: null,
					}
				]
			}
		},
		//追加
		addRofo() {
			this.rofoInfo.opRofoHoldLimtBos.push({})
		},
		//编辑追加
		dictaddRofo() {
			this.getrofo.rofoHoldLimtVos.push({})
		},
		//新增
		onSubmit() {
			let form = this.$refs.formRef;
			form.validate().then(() => {
				rofoApi.onSubmit(this.rofoInfo).then((resp) => {
					this.query();
					this.open = false;
				})
			})
		},
		//删除
		delrofoInfo(id) {
			rofoApi.delrofoInfo(id).then((resp) => {
				this.query();
			})
		},
		//启用
		enableRofo(id) {

			rofoApi.enableRofo(id).then((resp) => {
				this.query();
			})
		},
		//禁用
		disRofo(id) {

			rofoApi.disRofo(id).then((resp) => {
					this.query();
			})
		},
		//查看
		getRofo(id) {
			this.nftData = [];
			this.viewopen = true;
			rofoApi.getRofo(id).then((resp) => {
				this.getData = resp
				this.nftData.push(resp)
				this.condition = this.getData.opRofoHoldLimtVos
			})
		},
		//修改回显
		editRofo(id) {
			this.title = '编辑（优先购快照）任务';
			rofoApi.getRofo(id).then((resp) => {
				console.log(resp.snapshotTime)
				this.getrofo = resp;
				this.getrofo.rofoHoldLimtVos = resp.opRofoHoldLimtVos


			})
			this.dictopen = true;
		},
		//修改保存
		edit() {
			let dictform = this.$refs.dictFormRef;
			this.dictRofo.id = this.getrofo.id
			this.dictRofo.taskName = this.getrofo.taskName
			this.dictRofo.nftId = this.getrofo.nftId
			this.dictRofo.snapshotTime = this.getrofo.snapshotTime;
			this.dictRofo.opRofoHoldLimtBos = this.getrofo.rofoHoldLimtVos
			dictform.validate().then(() => {
				rofoApi.edit(this.dictRofo).then((resp) => {
					this.query();
					this.dictopen = false;
				})
			}).catch((error) => {
				message.error('请填写完整信息');
			})
		},
		//渲染活动下拉框
		select() {
			rofoApi.select(1, 1000, {type: 1}).then((resp) => {
				this.filterInfo.options = resp.records
			})
		},
		//条件下拉框
		condSelect() {
			rofoApi.condSelect(1, 1000, {}).then((resp) => {

				this.condFilterInfo.options = resp.records
			})
		},
		//清空表单
		onClose() {
			this.$refs['formRef'].resetFields();
		},
		dictonClose() {
			this.$refs['dictFormRef'].resetFields();
		},
		//执行快照
		execute(id) {
			debugger
			rofoApi.execute(id).then((resp) => {
				this.query();
			})
		},
		//执行日志
		exelog(id) {
			this.exeLog = true;
			rofoApi.exelog(id).then((resp) => {
				debugger
				var exeLogData = resp;
				for (let i = 0; i < exeLogData.length; i++) {
					let exeLogDatum = exeLogData[i];
					var executeTime = dayjs(exeLogDatum.executeTime).format('YYYY-MM-DD HH:mm:ss');
					exeLogDatum.executeTime = executeTime;
				}
				this.exeLogList = exeLogData;
				this.query();
			})
		}
	},
	mounted() {
		this.query();
		this.select();
		this.condSelect();
	}
};
</script>
<style scoped>
</style>
